﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wwtfly.LoggerUtility;
using System.Data;
using Wwtfly.BBS.BackDAL.News;
using Wwtfly.BBS.Framework.Execption;
namespace Wwtfly.BBS.BackBLL.News
{
   public class NewsUIBLL
    {
       private const string NEWLIST_ERROR_CODE = "9999";
        /// <summary>
        /// 根据新闻类型查询10最新新闻
        /// </summary>
        /// <param name="TypeId"></param>
        /// <returns></returns>
        public static DataTable NewsList(int top,string TypeId)
        {
            try
            {
                DataTable dt = NewsUIDAL.NewsList(top, TypeId);
                return dt;
            }
            catch (Exception ex)
            {
                LoggerManage.Error(new LogMessageParams()
                {
                    ModuleID = "NewsBLL",
                    FuncCode = "NewsList(int top,string TypeId)",
                    Level = AppErrorLevel.EROR,
                    ErrCode = NEWLIST_ERROR_CODE,
                    Excep = ex,
                    logMessage = "根据新闻类型查询新闻.出错",
                    ProgramName = "Wwtilfy.BBS"
                });
                throw new WwtflyBusinessException("E_" + NEWLIST_ERROR_CODE, ex);
            }
        }
       

    }
}
